﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _4_01_文件对话框
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = "C:\\Users\\AIT\\Desktop\\006-WinForm\\MarkDown文档";
            openFileDialog.Filter="图片文件|*.png";
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
               this.textBox1.Text = openFileDialog.FileName;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {

            if (this.saveFileDialog1.ShowDialog() == DialogResult.OK) 
            {
                this.textBox1.Text = saveFileDialog1.FileName;
                this.textBox1.Text = saveFileDialog1.FileName;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK) { 
            this.textBox1.Text=folderBrowserDialog1.SelectedPath;
            }
        }
    }
}
